﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using EuroManager.Domain.Simulator.World;

namespace EuroManager.Domain.Simulator.AI.States
{
    public class ChaseBallState : IState
    {
        private IPlayer player;

        public ChaseBallState(IPlayer player)
        {
            Contract.Requires(player != null);

            this.player = player;
        }

        public void Execute()
        {
            if (player.CanReachBall)
            {
                player.TrapBall();
                player.ControlBall();
            }
            else
            {
                player.RunToBall();
            }
        }
    }
}
